<template>
	<!-- paysucceed支付成功 -->
	<view class="p_wp">
		<view class="top">
			<view class="t_flex">
				<image src="/static/dui.png" mode="widthFix"></image>
				<view class="t_pay">
					<view class="t_succ">收款成功！</view>
					<view>手动核销！</view>
				</view>
			</view>
			<view class="dynamic">
				{{info.checktime}}
			</view>
		</view>
		<view class="info">
			<view class="bg"></view>
			<view class="content">
				<view class="tit"><text>￥</text>{{info.price}}<text class="tit_small" v-if="info.paymode == 0">(扣除多米街消费卡)</text></view>
				<view v-if="info.paymode == 0"><text class="left">多米街卡内余额:</text>{{info.usemoney}}</view>
				<view><text class="left">实际到账:</text>{{info.realprice}}</view>
				<view><text class="left">下单时间:</text>{{info.paytime}}</view>
			</view>
		</view>
		<view class="message" v-if="info.paymode == 0">
			[尊敬的收银员]<br>
			请扣除多米街平台<br>
			在您店内会员卡的余额！<br>
			（如没有会员卡系统请忽略）<br>
			<view class="purple">多米街会员卡绑定手机号为</view>
			<view class="red">{{info.mobile}}</view>
			<view class="purple">扣除{{info.price}}元</view>
		</view>
		<view class="btns">
			<view class="btn" @click="$navTo('/pages/business/collectionrecord')">查看核销明细</view>
			<view class="btn" v-if="info.paymode != 0" @click="$navTo('/pages/userservice/commission')">查看到账明细</view>
		</view>
		<view class="go_home" @click="$navTo('/pages/mallHome/selfMall')"><text>返回首页</text></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderid: '',
				info: {
					price: '',
					usemoney: '',
					checktime: '',
					mobile: '',
					paymode:-1,
				},
			}
		},
		onLoad(option) {
			if (option.scene) {
				this.orderid = option.scene;
			} else if (option.q) {
				let scan_url = decodeURIComponent(option.q);
				this.orderid = this.gup('orderid', scan_url);
			} else {
				this.orderid = option.orderid;
			}
			this.getInfo();
		},
		methods: {
			gup(name, url) {
				if (!url) url = location.href;
				name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
				var regexS = "[\\?&]" + name + "=([^&#]*)";
				var regex = new RegExp(regexS);
				var results = regex.exec(url);
				return results == null ? null : results[1];
			},
			getInfo() {
				this.$axios('checkorder/checked', 'POST', 'supplier', {
					orderid: this.orderid
				}).then(res => {
					if (res.data.code == 200) {
						this.info = res.data.data;
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #FBF8FE;
		color: $font-color-base;
		padding-bottom: 160rpx;
	}

	.succeed_image {
		display: block;
		margin: 0 auto;
		height: 280upx *0.8;
		width: 340upx*0.8;
	}
	.top{
		background: #9532E4;
		padding: 26rpx 0 60rpx;
		.t_flex{
			display: flex;
			justify-content: center;
			align-items: center;
			image{
				width: 108rpx;
			}
			.t_pay{
				color: #FFFFFF;
				font-size: 24rpx;
				padding-left: 30rpx;
				.t_succ{
					font-size: 40rpx;
					font-weight: 600;
					margin-bottom: 10rpx;
				}
			}
		}
		.dynamic{
			font-size: 40rpx;
			font-weight: 600;
			text-align: center;
			color: #fff;
			margin-top: 34rpx;
			margin-bottom: 20rpx;
		}
	}
	.info{
		width:90%;
		margin: 0 auto;
		margin-top: -40rpx;
		.bg{
			width: 100%;
			height: 18rpx;
			background: #6303AE;
			border-radius: 12rpx;
		}
		.content{
			width: 95%;
			height: 470rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 2rpx 14rpx 0rpx #E7CAFF;
			border-radius: 0rpx 0rpx 12rpx 12rpx;
			padding: 0 20rpx;
			color: #333333;
			margin: 0 auto;
			margin-top: -6rpx;
			view{
				line-height: 60rpx;
				font-size: 24rpx;
				.left{
					margin-right: 20rpx;
				}
			}
			.tit{
				font-size: 48rpx;	
				font-weight: 600;
				border-bottom: 1rpx solid #DEDEDE;
				padding: 36rpx 0px;
				margin-bottom: 24rpx;
				text-align: center;
				.tit_small{
					display: block;
					line-height: 1;
					color: #999999;
					font-size: 28rpx;
					font-weight: 400;
				}
				text{
					font-size: 28rpx;
				}
			}
		}
	}
	.message{
		color: #999999;
		font-size: 28rpx;
		text-align: center;
		padding: 40rpx 20rpx 0;
		.purple{
			color: #9532E4;
			font-weight: 600;
		}
		.red{
			color: #FD5448;
			font-weight: 600;
		}
	}
	.btns{
		display: flex;
		justify-content: center;
		margin-top: 60rpx;
		.btn{
			margin: 0 20rpx;
			width: 250rpx;
			height: 78rpx;
			border-radius: 40rpx;
			border: 2rpx solid #8615E1;
			font-size: 28rpx;
			color: #8615E1;
			line-height: 78rpx;
			text-align: center;
		}
	}
	.li,
	.li2,
	.li3,
	.li4,
	.li6 {
		text-align: center;
		line-height: 50upx;

		text {
			display: inline-block;
			width: 50%;
			font-size: 34upx;
			
		}

		text:nth-of-type(1) {
			text-align: right;
		}

		text:nth-of-type(2) {
			text-align: left;
		}
	}

	.li4 {
		font-weight: bold;
		font-size: 42upx;
		line-height: 70upx;
	}

	.li5 {
		color: #000;
		font-size: 42upx;
		letter-spacing: 2px;
		transform: scaleY(1.3);
	}

	.li6 {
		color: #000;

		text {
			width: auto;
		}
	}

	.li7 {
		padding-top: 40upx;
		color: rgb(16, 52, 235);
		text-align: center;
		font-size: 32upx;
		
		text {
			display: block;
			margin: 10upx 0upx;
		}

		.phone {
			color: red;
			font-size: 38upx;
		}
	}

	.li2 {
		padding-bottom: 20upx;
	}

	.li3 text {
		color: $base-color;
	}

	.go_home{
		width: 100%;
		height: 148rpx;
		position: fixed;
		bottom: 0;
		background: #fff;
		font-size: 28rpx;
		color: #FFFFFF;
		line-height: 74rpx;
		text-align: center;
		text{
			width: 396rpx;
			height: 74rpx;
			background: linear-gradient( 270deg, #8917E2 0%, #B92DF1 100%);
			border-radius: 38rpx;
			margin: 30rpx auto;
			display: block;
		}
	}
</style>